<?php

namespace App\Models\Api;

class ShieldCompany extends ApiModel
{
    //表名
    protected $table = 'shieldcompanies';
    public $timestamps = false;

    protected $guarded = [];

    public function company_basic()
    {
        return $this->hasOne(CompanyBasic::class, 'uid', 'company_uid')
            ->select('uid', 'company_name');
    }

    public function getCompanyNameAttribute()
    {
        return $this->company_basic ? $this->company_basic->company_name : '';
    }
}
